package com.luoshi.common.exception.ucenter;

import com.luoshi.common.result.ResultCodeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @ClassName MobileExist
 * @Description: 手机号码是否存在异常类
 * @Author luochangqin
 * @Date 2021/6/5
 * @Version V1.0
 **/
@Data
@ApiModel(value = "自定义手机号码已存在异常类")
public class MobileExistException extends RuntimeException{
    @ApiModelProperty(value = "响应异常代码")
    private Integer code;

    /**
     * 有参构造器，返回码在枚举类中
     * @param resultCodeEnum
     */
    public MobileExistException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }
}
